Skip to content

enterfullscreen action (#372)#373

Open
liberato-at-chromium wants to merge 5 commits intow3c:mainfrom
liberato-at-chromium:main
Open

enterfullscreen action (#372)#373
liberato-at-chromium wants to merge 5 commits intow3c:mainfrom
liberato-at-chromium:main

Conversation

@liberato-at-chromium
Copy link
Copy Markdown

@liberato-at-chromium liberato-at-chromium commented Apr 6, 2026

Spec changes for the enterfullscreen action (#372 ).


Preview | Diff

Comment thread index.bs Outdated
@liberato-at-chromium
Copy link
Copy Markdown
Author

@marcoscaceres - if i remember, you requested an explainer. Please let me know if this addresses your concerns.

There didn't seem to be an obvious place to put it in the mediasession repo; there's only the top-level one there. So, this seemed like an okay 'for posterity' place assuming we're not going to change it much. Happy to move it elsewhere.

MediaSession enterfullscrreen Action Explained

Objectives

Fullscreen playback is a feature found in many web video experiences. However,
the UA currently has no reliable way to request that the site begin fullscreen
mode on behalf of the user. The enterfullscreen MediaSession action allows
a site to provide a hook for the UA to request the fullscreen experience.

Use-Cases

If the UA eere ablw to request the fullscreen experience, some example
use-cases include:

  • UI affordances in browser UI for fullscreen, such as Chrome's global
    media controls.
  • UI affordances in picture-in-picture video playback to transition directly
    to fullscreen playback.
  • Accessibility - enterfullscreen, along with other action handlers
    for (e.g.) captioning, playback speed, etc., can provide customized, a11y-
    friendly UI.

The Current Gap

Many websites and JavaScript media player librarie provide UI affordances
to enter fullscreen playback. The site is free to take arbitrarily complex
actions in response. Examples that were observed "in the wild" include:

  • Requesting fullscreen on the video element via requestFullscreen()
  • Requesting fullscreen on some containing element to preserve controls etc.
  • Doing programatic styling / relayout of the DOM in addition to calling
    requestFullscreen() on some element.

From the UA's perspective, all of this is opaque. It cannot simply request
fullscreen on any particular element since the UA has no idea which one is
approporiate. The UA also doesn't know if there are other actions the site
wishes to take beyond calling requestFullscreen().

The enterfullscreen action handler lets the site provide site-specific
processing. Further, as a callback, it's likely quite asy for sites to
re-use their existing code that is invoked by the site's fullscreen control.

Potential for Abuse

The potential for misuse of the enterfullscreen action handler isn't
particularly different than any other existing action handler, e.g. play
or enterpictureinpicture. In fact, except for the name of the action
and differences in the handler's argument list, the attack surface for them
is identical.

Default Behavior

The UA may implement a default handler for `enterfullscreen, if desired.
However, given the wide range of site behaviors as described above, the
resulting user experience could be very uneven. Some use-cases (e.g. a11y)
might provide benefits that outweigh this, while others (e.g. picture-in-
picture), might not.

The proposed spec does not place any restrictions on the default behavior
for these reasons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants